<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>register</title>
    <script src="/js/jquery-3.1.1.min.js"></script>
    <script src="/js/vue.js"></script>
</head>
<body>
<div id="zhuche">
    <div>
        <label>用户名<input type="text" v-model="user.sysName"></label>
    </div>
    <div>
        <label>密码1<input type="text" v-model="user.sysPwd"></label>
    </div>
    <div>
        <label>密码2<input type="text" v-model="user.sysPwd2"></label>
    </div>
    <div>
        <label>手机号<input type="text" v-model="user.sysPhones"></label>
    </div>
    <div>
        <button @click="register()" >注册</button>
    </div>

</div>
</body>
<script>
    new Vue({
        el:"#zhuche",
        data:{
            user:{
                sysName:"",
                sysPwd:"",
                sysPwd2:"",
                sysPhones:""
            }
        },
        methods:{
            register:function () {
                var self = this;
                $.ajax({
                    url:"/user/register",
                    type:"post",
                    data: self.user,
                    contentType:"application/x-www-form-urlencoded",
                    dataType:"json",
                    success:function (data) {
                        console.log(data.info)
                        alert(data.info)
                    }
                })
            }
        }
    })
</script>
</html>